@extends('frontend.default.app')
@section('content')

    <!-- banner部分 -->
    <div class="banner news">
        <div class="title">
            <p>{{$post->title}}</p>
            <p class="en"><i class="layui-icon layui-icon-date"></i> {{time_ago($post->created_at)}}
                <i class="layui-icon layui-icon-note"></i>
                @foreach($post->manyCategory as $cat)
                <span class="layui-badge-rim">{{$cat->title}}</span>
                @endforeach
            </p>
        </div>
    </div>
    <!-- main部分 -->
    <div class="main-newsdate">
        <div class="layui-container">
            <div class="layui-row layui-col-space30">
                <div class="layui-col-md9 post-content">
                    {!! $post->post_content !!}
                </div>
                <div class="layui-col-md3">
                    @include('frontend.default.sidebar')
                </div>
            </div>



        </div>
    </div>


@endsection

@section('script')
    <script>
        layui.use('code', function(){ //加载code模块
            layui.code({
                elem: '.post-content pre', //默认值为.layui-code
                skin: 'notepad',
                about: false
            });
        });
    </script>
@endsection